import java.util.Scanner;
class Person {
    private String name;
    private boolean gender;
    private int age;
    private int id;
    private static int count = 0;
    static {
        System.out.println("This is static initialization block");
    }
    {
        id = count++;
        System.out.println("This is initialization block, id is " + id);
    }
    public Person() {
        System.out.println("This is constructor");
    }
    public Person(String name, boolean gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }
    @Override
    public String toString() {
        return "Person [name=" + name + ", age=" + age + ", gender=" + gender + ", id=" + id + "]";
    }
}
public class Main{
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        Person[] persons = new Person[n];

        for (int i = 0; i < n; i++) {
            String name = scanner.next();
            int age = scanner.nextInt();
            boolean gender = scanner.nextBoolean();
            persons[i] = new Person(name, gender, age);
        }
        for (int i = n - 1; i >= 0; i--) {
            System.out.println(persons[i].toString());
        }
        Person person = new Person();
        System.out.println(person);
    }
}